package zjc.数组;

public class 数组遍历访问 {
    public static void main(String[] args) {
        String[]names=new String[]{"蔡胜超","周俊","徐佳明"};
        for(int i=0;i< names.length;i++){
            System.out.println(names[i]+"是朱佳铖儿子");
        }
        System.out.println("------------");
        //案例求数组求和；
        int[]a={1,5,8,6,9};
        int sum=0;
        for (int i = 0; i < a.length; i++) {
            sum+=a[i];
        }
        System.out.println(sum);
    }
}
